<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
use module\open\middleware\Auth;

Route::rest([
    'update' => ['PUT', '', 'update'],
    'delete' => ['DELETE', '', 'del'],
]);

Route::get('', 'Index/index');

$ns = '\\app\\controller\\';
Route::group(function(){
    Route::get('version', 'Index@version');
    Route::post('file/upload', 'File@upload');
    Route::post('file/multi', 'File@multi');    
    Route::resource('city', 'City')->only(['index']);
    Route::resource('sms', 'Sms')->only(['save'])->middleware('throttle', [
        'visit_rate' => '10/m',
    ]);    
})->prefix($ns)->middleware('format');

Route::post('token', 'Visitor/token')->middleware('throttle', [
    'visit_rate' => '6/m',
]);
Route::post('forget', 'Visitor/forget');
Route::post('bind', 'Visitor/bind');
Route::post('visitor/wxlogin', 'Visitor/wxlogin');
Route::post('pay/notify', 'Pay/notify');

Route::group(function(){

})->middleware(Auth::class);

Route::miss('\\app\\controller\\Error@index');
